<template>
	<view class="login know-flex konw-center font-weight-bold  bg-base konw-column">
		<view class="login-top  know-flex know-align-center konw-center color-FFFFFF">
			<view>欢迎登录钱花哪去儿</view>
		</view>
		<view class="bg-FFFFFF login-content know-flex know-align-center konw-center  konw-column">
			<!-- <view style="width: calc(100% - 100rpx);">
				<input type="text" value="" placeholder="请输入手机号码" class="login-input" />
			</view>
			<view class="login-button bg-base color-FFFFFF font-28 clickClass">
				立即登录
			</view>
			<view class="font-24 color-black9">或</view> -->
			<view class="login-button bg-base color-FFFFFF font-28 clickClass" @click="login">
				一键登录
			</view>
		</view>
	</view>
</template>

<script>
	import {userLogin} from '@/api/http/login.js'
	export default {
		data() {
			return {
				
			}
		},
		onShow() {
			uni.removeStorageSync('token')
		},
		methods: {
			login() {
				uni.showLoading({
					icon:'loading',
					title:'登录中,请稍后',
					mask:true,
				})
				userLogin({
					uuid: '7adf0e872bdce03e3'
				}).then(res => {
					let token = res.data
					uni.setStorageSync('POOL_TOKEN',token)
					uni.hideLoading()
					uni.redirectTo({
						url:'../index/index'
					})
					
					return 
				})
				setTimeout(()=>{
					uni.hideLoading()
				},10000)
				
			}
		}
	}
</script>

<style lang="scss">
	.login {
		height: 100vh;

		&-top {
			width: 100%;
			height: 450rpx;
		}

		&-content {
			height: calc(100vh - 450rpx);
			border-top-left-radius: 40rpx;
			border-top-right-radius: 40rpx;

			view {
				margin-top: 30rpx;
			}
		}

		&-input {
			height: 94rpx;
			border-bottom: 2rpx solid #EEEEEE;
		}

		&-button {
			height: 90rpx;
			text-align: center;
			line-height: 90rpx;
			border-radius: 90rpx;
			width: calc(100% - 100rpx);
		}
	}
</style>
